home *** CD-ROM | disk | FTP | other *** search
/ MAG.E 3 / MAG.E 3 (Disk 2 of 2).adf / Amos_Code / Paranoia.AMOS / Paranoia.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1992-09-02  |  14.6 KB  |  340 lines

  1. 'Paranoia Character Generator
  2. 'By Adam Booth 
  3. '
  4. PINT=30
  5. Dim SG$(8),M$(20),SS$(20),AGISKILL$(6),DEXSKILL$(8),MOXSKILL$(14),CHUSKILL$(11),MECSKILL$(11),SGAGI(6),SGDEX(8),SGMOX(14),SGCHU(11),SGMEC(11),AGI(6),CHU(11),DEX(8),MEC(11),MOX(14),SN$(15),SN(15),SM(15)
  6. Data "Internal Security","Tech Services","HPD & MC","Armed Forces","PLC","Power Services","R&D","CPU"
  7. For I=1 To 8 : Read SG$(I) : Next 
  8. Data "Adrenalin Control","Charm","Deep Probe","ElectroShock","Empathy","Energy Field","Hypersenses","Levitation","Machine Empathy*","Matter Eater","Mechanical Intuition","Mental Blast","Polymorphism","Precognition","Pyrokinesis","Regeneration"
  9. Data "Telekinesis","Telepathy","Teleport","X-Ray Vision"
  10. For I=1 To 20 : Read M$(I) : Next 
  11. Data "Anti-Mutant","Computer Phreaks","Communists","Corpore Metal","Death Leopard","Death Leopard","FCCCP","FCCCP","Frankenstein Destroyers","Free Enterprise"
  12. Data "Humanists","Illuminati","Mystics","Pro Tech","Psion","Purge","Romantics","Sierra Club","Sierra Club","Other"
  13. For I=1 To 20 : Read SS$(I) : Next 
  14. Data "Force Sword","Grenade","Neurowhip","Primitive Melee Weapons","Truncheon","Unarmed"
  15. For I=1 To 6 : Read AGISKILL$(I) : SGAGI(I)=12 : Next 
  16. Data "Energy Weapons","Field Weapons","Laser Weapons","Primitve Missile Weapons","Projectile Weapons","Vehicle Aimed Weapons","Vehicle Field Weapons","Vehicle Launched Weapons"
  17. For I=1 To 8 : Read DEXSKILL$(I) : SGDEX(I)=12 : Next 
  18. Data "Biochemical Therapy","Biosciences","Chemical Engineering","Data Analysis","Data Search","Demolition","Electronic Engineering","Mechanical Engineering","Medical"
  19. Data "Nuclear Engineering","Security","Stealth","Surveillance","Survival"
  20. For I=1 To 14 : Read MOXSKILL$(I) : SGMOX(I)=12 : Next 
  21. Data "Bootlicking","Bribery","Con","Fast Talk","Forgery","Interrogation","Intimidation","Motivation","Oratory","Pychescan","Spurious Logic"
  22. For I=1 To 11 : Read CHUSKILL$(I) : SGCHU(I)=12 : Next 
  23. Data "Autocar Op. & Maint.","Copter Op. & Maint.","Crawler Op & Maint.","Docbot Op. & Maint.","Flybot Op. & Maint.","Habitat Engineering","Hover Op. & Maint.","Jackobot Op. & Maint.","Scrubot Op. & Maint.","Transbot Op & MAint."
  24. Data "Vulturecraft Op. & Maint."
  25. For I=1 To 11 : Read MECSKILL$(I) : SGMEC(I)=12 : Next 
  26. Randomize Timer
  27. Def Fn D20(R)=Rnd(19)+1
  28. Screen Open 0,640,256,16,Hires
  29. Curs Off 
  30. Cls 0
  31. Hide 
  32. Flash Off 
  33. Unpack 16 To 0
  34. Palette 0,0
  35. Wind Open 1,64,50,64,22
  36. Curs Off 
  37. MAIN:
  38. Window 1
  39. Clw 
  40. Centre "Paranoia Character Generator 1.0"
  41. Locate 1,1
  42. Centre "A Game Master Aid By Adam Booth"
  43. Wait Key 
  44. Clw 
  45. Print "Computer Rolls Dice?"
  46. Print "                     Yes"
  47. Print "                     No"
  48.     Repeat 
  49.     I$=Inkey$
  50.     If I$="y" Then COMPROLL=1 : Q=1
  51.     If I$="n" Then COMPROLL=0 : Q=1
  52.     Until Q=1
  53. Clw 
  54. Centre "Attributes"
  55. Locate 3,3 : Print "Strength........ __     Carrying Capacity... __"
  56. Locate 3,4 : Print "                        Damage Bonus........ __"
  57. Locate 3,5 : Print "Endurance....... __     Macho Bonus......... __"
  58. Locate 3,6 : Print "Agility......... __     Agility Skillbase... __"
  59. Locate 3,7 : Print "Dexterity....... __     Dexterity Skillbase. __"
  60. Locate 3,8 : Print "Moxie........... __     Moxie Skillbase..... __"
  61. Locate 3,9 : Print "Chutzpah........ __     Chutzpah Skillbase.. __"
  62. Locate 3,10 : Print "Mech. Aptitude.. __     Mech. Skillbase..... __"
  63. Locate 3,11 : Print "Power........... __"
  64. Rem *** Strength *** 
  65.         X=19 : Y=3 : Locate 0,Y : Print "->" : Gosub ROLL : STR=R : Locate X,Y : Print R;" " : Locate 0,Y : Print "  "
  66.         If STR<13 Then CARRYCAP=25
  67.         If STR>12 Then CARRYCAP=25+(STR-12)*5
  68.         Locate 47,3 : Print CARRYCAP
  69.         DB=0 : If STR>13 Then DB=1 : If STR>18 Then DB=2
  70.         Locate 47,4 : Print DB;" "
  71. Rem *** Endurance ***
  72.         X=19 : Y=5 : Locate 0,Y : Print "->" : Gosub ROLL : ENU=R : Locate X,Y : Print R;" " : Locate 0,Y : Print "  "
  73.         MB=0 : If ENU>13 Then MB=1 : If ENU>18 Then MB=2
  74.         Locate 47,5 : Print MB;" "
  75. Rem *** Agility ***
  76.         X=19 : Y=6 : Locate 0,Y : Print "->" : Gosub ROLL : AGI=R : Locate X,Y : Print R;" " : Locate 0,Y : Print "  "
  77.         AGISB=0
  78.         If AGI>3 Then AGISB=1 : If AGI>6 Then AGISB=2 : If AGI>10 Then AGISB=3 : If AGI>14 Then AGISB=4 : If AGI>17 Then AGISB=5
  79.         Locate 47,Y : Print AGISB;" "
  80. Rem *** Dexterity ***
  81.         X=19 : Y=7 : Locate 0,Y : Print "->" : Gosub ROLL : DEX=R : Locate X,Y : Print R;" " : Locate 0,Y : Print "  "
  82.         DEXSB=0
  83.         If DEX>3 Then DEXSB=1 : If DEX>6 Then DEXSB=2 : If DEX>10 Then DEXSB=3 : If DEX>14 Then DEXSB=4 : If DEX>17 Then DEXSB=5
  84.         Locate 47,Y : Print DEXSB;" "
  85. Rem *** Moxie ***
  86.         X=19 : Y=8 : Locate 0,Y : Print "->" : Gosub ROLL : MOX=R : Locate X,Y : Print R;" " : Locate 0,Y : Print "  "
  87.         MOXSB=0
  88.         If MOX>3 Then MOXSB=1 : If MOX>6 Then MOXSB=2 : If MOX>10 Then MOXSB=3 : If MOX>14 Then MOXSB=4 : If MOX>17 Then MOXSB=5
  89.         Locate 47,Y : Print MOXSB;" "
  90. Rem *** Chutzpah *** 
  91.         X=19 : Y=9 : Locate 0,Y : Print "->" : Gosub ROLL : CHU=R : Locate X,Y : Print R;" " : Locate 0,Y : Print "  "
  92.         CHUSB=0
  93.         If CHU>3 Then CHUSB=1 : If CHU>6 Then CHUSB=2 : If CHU>10 Then CHUSB=3 : If CHU>14 Then CHUSB=4 : If CHU>17 Then CHUSB=5
  94.         Locate 47,Y : Print CHUSB;" "
  95. Rem *** Mechanical Aptitude ***
  96.         X=19 : Y=10 : Locate 0,Y : Print "->" : Gosub ROLL : MEC=R : Locate X,Y : Print R;" " : Locate 0,Y : Print "  "
  97.         MECSB=0
  98.         If MEC>3 Then MECSB=1 : If MEC>6 Then MECSB=2 : If MEC>10 Then MECSB=3 : If MEC>14 Then MECSB=4 : If AGI>17 Then AGISB=5
  99.         Locate 47,Y : Print MECSB;" "
  100. Rem *** Power ***
  101.         X=19 : Y=11 : Locate 0,Y : Print "->" : Gosub ROLL : POW=R : Locate X,Y : Print R;" " : Locate 0,Y : Print "  "
  102. Rem *** Service Group ***
  103.         Locate 3,14 : Print "Service Group Roll:" : X=22 : Y=14 : Gosub ROLL : Locate X,Y : Print R;" "
  104.         If R<3 Then SG=1
  105.         If R>2 Then SG=2
  106.         If R>4 Then SG=3
  107.         If R>8 Then SG=4
  108.         If R>11 Then SG=5
  109.         If R>14 Then SG=6
  110.         If R>16 Then SG=7
  111.         If R>18 Then SG=8
  112.         Locate X,Y : Print SG$(SG)
  113. Rem *** Mutation *** 
  114.         Locate 3,16 : Print "Mutation Roll:" : X=17 : Y=16 : Gosub ROLL
  115.         M=R : Locate X,Y : Print M$(M)
  116. Rem *** Secret Society *** 
  117. SECRET:
  118.         Locate 3,18 : Print "Secret Society Roll:" : X=23 : Y=18 : Gosub ROLL
  119.         SS=R : If SS=15 and M<>3 and M<>5 and M<>6 and M<>8 and M<>12 and M<>14 and M<>15 and M<>17 and M<>18 and M<>19 Then Goto SECRET
  120.         Locate X,Y : Print SS$(SS)
  121. Locate 1,20 : Centre "Press Any Key to choose Skills" : Wait Key 
  122. Clw 
  123. If SG=1 Then SGAGI(5)=14 : SGAGI(6)=14 : SGCHU(6)=14 : SGCHU(7)=14 : SGDEX(3)=14 : SGMOX(11)=14 : SGMOX(13)=14
  124. If SG=2 Then SGCHU(11)=14 : SGMEC(1)=14 : SGMEC(4)=14 : SGMEC(8)=14 : SGMEC(9)=14 : SGMOX(7)=14 : SGMOX(8)=14 : SGMEC(10)=14
  125. If SG=3 Then SGCHU(1)=14 : SGCHU(3)=14 : SGCHU(5)=14 : SGCHU(9)=14 : SGMEC(4)=14 : SGMOX(1)=14 : SGMOX(9)=14
  126. If SG=4 Then SGAGI(1)=14 : SGAGI(4)=14 : SGAGI(6)=14 : SGCHU(8)=14 : SGDEX(3)=14 : SGDEX(5)=14 : SGMEC(11)=14 : SGMOX(6)=14 : SGMOX(14)=14
  127. If SG=5 Then SGCHU(2)=14 : SGCHU(4)=14 : SGCHU(5)=14 : SGMEC(6)=14 : SGMEC(8)=14 : SGMOX(2)=14
  128. If SG=6 Then SGCHU(11)=14 : SGMEC(6)=14 : SGMEC(8)=14 : SGMOX(3)=14 : SGMOX(7)=14 : SGMOX(8)=14 : SGMOX(10)=14
  129. If SG=7 Then SGMEC(8)=14 : SGMOX(2)=14 : SGMOX(4)=14 : SGMOX(5)=14 : SGMOX(7)=14 : SGMOX(8)=14
  130. If SG=8 Then SGCHU(4)=14 : SGCHU(7)=14 : SGCHU(8)=14 : SGCHU(10)=14 : SGMOX(4)=14 : SGMOX(5)=14
  131. Locate 1,0 : Print "[1] Agility" : Locate 13,0 : Print "[2] Dexterity" : Locate 27,0 : Print "[3] Moxie" : Locate 37,0 : Print "[4] Chutzpah" : Locate 50,0 : Print "[5] Mechanical"
  132. Locate 2,20 : Centre "Use Numbers for skill type, Arrows to select, +/- to"
  133. Locate 2,21 : Centre "increase/decrease points on skills [ESC] when finished"
  134. Locate 1,19 : Print "<Skill> "; : Pen 6 : Print "<Skill Max>"; : Pen 4 : Print " <SkillBase> "; : Pen 3 : Print "<Points on skill>"; : Pen 2 : Print " <Skill Total>"
  135. Wind Open 2,64,58,64,18
  136. Curs Off 
  137. NOSK=6 : POS=1
  138. AGILITY:
  139. SB=AGISB
  140. For I=1 To NOSK : SN$(I)=AGISKILL$(I) : SN(I)=AGI(I) : SM(I)=SGAGI(I) : Next 
  141. 0
  142. Gosub SHIFT
  143. Locate 0,0 : Centre "Agility"
  144. Locate 53,0 : Print "Points:";PINT;" "
  145. Gosub SHO
  146. Repeat 
  147. I$=Inkey$
  148. If I$=Chr$(27) Then Goto FINISH
  149. Until I$<>""
  150. If I$="2" Then Clw : POS=1 : NOSK=8 : Goto DEXTERITY
  151. If I$="3" Then Clw : POS=1 : NOSK=14 : Goto MOXIE
  152. If I$="4" Then Clw : POS=1 : NOSK=11 : Goto CHUTZPAH
  153. If I$="5" Then Clw : POS=1 : NOSK=11 : Goto MECHANICAL
  154. If I$="+" and AGI(POS)+AGISB<SGAGI(POS) and PINT>0 Then PINT=PINT-1 : AGI(POS)=AGI(POS)+1 : SN(POS)=AGI(POS)
  155. If I$="-" and AGI(POS)>0 Then PINT=PINT+1 : AGI(POS)=AGI(POS)-1 : SN(POS)=AGI(POS)
  156. Goto 0
  157. End 
  158. DEXTERITY:
  159. SB=DEXSB
  160. For I=1 To NOSK : SN$(I)=DEXSKILL$(I) : SN(I)=DEX(I) : SM(I)=SGDEX(I) : Next 
  161. 1
  162. Gosub SHIFT
  163. Locate 0,0 : Centre "Dexterity"
  164. Locate 53,0 : Print "Points:";PINT;" "
  165. Gosub SHO
  166. Repeat 
  167. I$=Inkey$
  168. If I$=Chr$(27) Then Goto FINISH
  169. Until I$<>""
  170. If I$="1" Then Clw : POS=1 : NOSK=6 : Goto AGILITY
  171. If I$="3" Then Clw : POS=1 : NOSK=14 : Goto MOXIE
  172. If I$="4" Then Clw : POS=1 : NOSK=11 : Goto CHUTZPAH
  173. If I$="5" Then Clw : POS=1 : NOSK=11 : Goto MECHANICAL
  174. If I$="+" and DEX(POS)+DEXSB<SGDEX(POS) and PINT>0 Then PINT=PINT-1 : DEX(POS)=DEX(POS)+1 : SN(POS)=DEX(POS)
  175. If I$="-" and DEX(POS)>0 Then PINT=PINT+1 : DEX(POS)=DEX(POS)-1 : SN(POS)=DEX(POS)
  176. Goto 1
  177. MOXIE:
  178. SB=MOXSB
  179. For I=1 To NOSK : SN$(I)=MOXSKILL$(I) : SN(I)=MOX(I) : SM(I)=SGMOX(I) : Next 
  180. 2
  181. Gosub SHIFT
  182. Locate 0,0 : Centre "Moxie"
  183. Locate 53,0 : Print "Points:";PINT;" "
  184. Gosub SHO
  185. Repeat 
  186. I$=Inkey$
  187. Until I$<>""
  188. If I$=Chr$(27) Then Goto FINISH
  189. If I$="2" Then Clw : POS=1 : NOSK=8 : Goto DEXTERITY
  190. If I$="1" Then Clw : POS=1 : NOSK=6 : Goto AGILITY
  191. If I$="4" Then Clw : POS=1 : NOSK=11 : Goto CHUTZPAH
  192. If I$="5" Then Clw : POS=1 : NOSK=11 : Goto MECHANICAL
  193. If I$="+" and MOX(POS)+MOXSB<SGMOX(POS) and PINT>0 Then PINT=PINT-1 : MOX(POS)=MOX(POS)+1 : SN(POS)=MOX(POS)
  194. If I$="-" and MOX(POS)>0 Then PINT=PINT+1 : MOX(POS)=MOX(POS)-1 : SN(POS)=MOX(POS)
  195. Goto 2
  196. CHUTZPAH:
  197. SB=CHUSB
  198. For I=1 To NOSK : SN$(I)=CHUSKILL$(I) : SN(I)=CHU(I) : SM(I)=SGCHU(I) : Next 
  199. 3
  200. Gosub SHIFT
  201. Locate 0,0 : Centre "Chutzpah"
  202. Locate 53,0 : Print "Points:";PINT;" "
  203. Gosub SHO
  204. Repeat 
  205. I$=Inkey$
  206. Until I$<>""
  207. If I$=Chr$(27) Then Goto FINISH
  208. If I$="2" Then Clw : POS=1 : NOSK=8 : Goto DEXTERITY
  209. If I$="1" Then Clw : POS=1 : NOSK=6 : Goto AGILITY
  210. If I$="3" Then Clw : POS=1 : NOSK=14 : Goto MOXIE
  211. If I$="5" Then Clw : POS=1 : NOSK=11 : Goto MECHANICAL
  212. If I$="+" and CHU(POS)+CHUSB<SGCHU(POS) and PINT>0 Then PINT=PINT-1 : CHU(POS)=CHU(POS)+1 : SN(POS)=CHU(POS)
  213. If I$="-" and CHU(POS)>0 Then PINT=PINT+1 : CHU(POS)=CHU(POS)-1 : SN(POS)=CHU(POS)
  214. Goto 3
  215. MECHANICAL:
  216. SB=MECSB
  217. For I=1 To NOSK : SN$(I)=MECSKILL$(I) : SN(I)=MEC(I) : SM(I)=SGMEC(I) : Next 
  218. 4
  219. Gosub SHIFT
  220. Locate 0,0 : Centre "Mechanical Aptitude"
  221. Locate 53,0 : Print "Points:";PINT;" "
  222. Gosub SHO
  223. Repeat 
  224. I$=Inkey$
  225. Until I$<>""
  226. If I$=Chr$(27) Then Goto FINISH
  227. If I$="2" Then Clw : POS=1 : NOSK=8 : Goto DEXTERITY
  228. If I$="1" Then Clw : POS=1 : NOSK=6 : Goto AGILITY
  229. If I$="3" Then Clw : POS=1 : NOSK=14 : Goto MOXIE
  230. If I$="4" Then Clw : POS=1 : NOSK=11 : Goto CHUTZPAH
  231. If I$="+" and MEC(POS)+MECSB<SGMEC(POS) and PINT>0 Then PINT=PINT-1 : CHU(POS)=CHU(POS)+1 : SN(POS)=CHU(POS)
  232. If I$="-" and MEC(POS)>0 Then PINT=PINT+1 : MEC(POS)=MEC(POS)-1 : SN(POS)=MEC(POS)
  233. Goto 4
  234. FINISH:
  235. Clw 
  236. Wind Close 
  237. Clw 
  238. Curs Off 
  239. 9
  240. Locate 0,10 : Centre "Save?"
  241. Repeat 
  242. I$=Inkey$
  243. Until I$<>""
  244. If I$="n" Then Cls : Print "Program Terminted..." : End 
  245. If I$="y" Then Goto 10
  246. Goto 9
  247. 10
  248. Locate 10,12
  249. Input "Filename (Specify Drive) :";F$
  250. If F$="" Then Goto 9
  251. Open Out 1,F$
  252. Print #1,"   ---------------------------------------------------------------------------"
  253. Print #1,"         Paranoia Character - Created with Paranoia Character Generator 1.0"
  254. Print #1,"   ---------------------------------------------------------------------------"
  255. Print #1,
  256. Print #1,"Name:                                             Player:"
  257. Print #1," Security Clearance (IR) R O Y G B I V (UV)       Service Group:";SG$(SG)
  258. Print #1,
  259. Print #1," ATTRIBUTES     "
  260. Print #1," Strength        ";STR; : If Len(Str$(STR))=2 Then Print #1," ";
  261. Print #1,"     Carrying Capacity   ";CARRYCAP
  262. Print #1,"                         Damage Bonus        ";DB
  263. Print #1," Endurance       ";ENU; : If Len(Str$(ENU))=2 Then Print #1," ";
  264. Print #1,"     Macho Bonus         ";MB
  265. Print #1," Agility         ";AGI; : If Len(Str$(AGI))=2 Then Print #1," ";
  266. Print #1,"     Agility Skillbase   ";AGISB
  267. Print #1," Dexterity       ";DEX; : If Len(Str$(DEX))=2 Then Print #1," ";
  268. Print #1,"     Dexterity Skillbase ";DEXSB
  269. Print #1," Moxie           ";MOX; : If Len(Str$(MOX))=2 Then Print #1," ";
  270. Print #1,"     Moxie Skillbase     ";MOXSB
  271. Print #1," Chutzpah        ";CHU; : If Len(Str$(CHU))=2 Then Print #1," ";
  272. Print #1,"     Chutzpah Skillbase  ";CHUSB
  273. Print #1," Mechanical Apt. ";MEC; : If Len(Str$(MEC))=2 Then Print #1," ";
  274. Print #1,"     Mech. Skillbase     ";MECSB
  275. Print #1," Power           ";POW
  276. Print #1,
  277. Print #1,"                              SKILLS"
  278. Print #1,
  279. Print #1,"Agility Skill Base :";AGISB
  280. For I=1 To 6
  281. If AGI(I)>0 Then A$=AGISKILL$(I) : B=30-Len(A$) : For K=1 To B : A$=A$+" " : Next : A$=A$+":" : Print #1,A$;AGISB+AGI(I)
  282. Next 
  283. Print #1,
  284. Print #1,"Dexterity Skill Base  :";DEXSB
  285. For I=1 To 8
  286. If DEX(I)>0 Then A$=DEXSKILL$(I) : B=30-Len(A$) : For K=1 To B : A$=A$+" " : Next : A$=A$+":" : Print #1,A$;DEXSB+DEX(I)
  287. Next 
  288. Print #1,
  289. Print #1,"Moxie Skill Base      :";MOXSB
  290. For I=1 To 14
  291. If MOX(I)>0 Then A$=MOXSKILL$(I) : B=30-Len(A$) : For K=1 To B : A$=A$+" " : Next : A$=A$+":" : Print #1,A$;MOXSB+MOX(I)
  292. Next 
  293. Print #1,
  294. Print #1,"Chutzpah Skill Base   :";CHUSB
  295. For I=1 To 11
  296. If CHU(I)>0 Then A$=CHUSKILL$(I) : B=30-Len(A$) : For K=1 To B : A$=A$+" " : Next : A$=A$+":" : Print #1,A$;CHUSB+CHU(I)
  297. Next 
  298. Print #1,
  299. Print #1,"Mechanical Skill Base :";MECSB
  300. For I=1 To 11
  301. If MEC(I)>0 Then A$=MECSKILL$(I) : B=30-Len(A$) : For K=1 To B : A$=A$+" " : Next : A$=A$+":" : Print #1,A$;MECSB+MEC(I)
  302. Next 
  303. Print #1,
  304. Print #1,"                       S E C R E T   S T U F F"
  305. Print #1,"Secret Society :";SS$(SS)
  306. Print #1,"Mutation       :";M$(M)
  307. End 
  308. SHO:
  309. For I=1 To NOSK
  310. Locate 3,I+2 : Print SN$(I); : Locate 28,I+2 : Pen 6 : Locate 30,I+2 : Print SM(I); : Pen 4 : Locate 34,I+2 : Print SB; : Pen 3 : Locate 37,I+2 : Print SN(I);" " : Pen 2 : Locate 41,I+2 : Print SB+SN(I);" "
  311. Next 
  312. Return 
  313. SHIFT:
  314. If I$=Chr$(30) Then Locate 0,POS+2 : Print "  " : POS=POS-1 : If POS<1 Then POS=NOSK
  315. If I$=Chr$(31) Then Locate 0,POS+2 : Print "  " : POS=POS+1 : If POS>NOSK Then POS=1
  316. Locate 0,POS+2 : Print "->";
  317. Return 
  318. ROLL:
  319. If COMPROLL=1 Then R= Fn D20(20) : Return 
  320. Locate X,Y
  321. Repeat 
  322. Repeat 
  323. I$=Inkey$
  324. Until I$<>""
  325. I=Asc(I$)-48
  326. Until I>-1 and I<10
  327. Print I
  328. Locate X+1,Y
  329. Repeat 
  330. Repeat 
  331. I$=Inkey$
  332. Until I$<>""
  333. If I$=Chr$(13) Then R=I : Goto ROLL1
  334. J=Asc(I$)-48
  335. Until I>-1 and I<10
  336. Print J
  337. R=I*10+J
  338. ROLL1:
  339. If R>0 and R<21 Then Return 
  340. Goto ROLL